package com.example.controller;

import com.example.dao.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping(value = "/student")
public class StudentController {

    @GetMapping
    public String queryStudent(@RequestParam(required = false) Integer id){
        String msg = "查询用户!"+id;
        return msg;
    }
    @PostMapping
    public String addStudent(@RequestBody Student student){
        String msg = "添加用户!"+student.toString();
        return msg;
    }
    @PutMapping
    public String updateStudent(@RequestBody Student student){
        String msg = "修改用户!"+student.toString();
        return msg;
    }

    @DeleteMapping
    public String deleteStudent(@RequestParam Integer id){
        String msg = "删除用户!"+id;
        return msg;
    }

}
